<template>
	<view>
    <z-nav-bar id="nav" bgColor="#ffffff" title="新手教程"></z-nav-bar>
<!--    <up-cell-group>-->
<!--      <up-cell @click="goDetilas(item)" v-for="(item,index) in list" :key="item" :title="item.title"></up-cell>-->
<!--    </up-cell-group>-->
    <view class="rail-container mgt-20" v-for="(item,index) in list" :key="index" @click="goDetilas(item)">
      <image class="coverImage" :src="item.coverImage"></image>
      <view class="right_box" >
        <view>
          <view>{{ item.title }}</view>
          <view>{{item.categoryName}}</view>
        </view>
        <view>发布日期：{{ item.createTime }}</view>

      </view>
    </view>

	</view>
</template>

<script>

import {onMounted,ref} from "vue";
import {tutoriaList} from '@/api/pagesShop'
import {commonStore} from '../stores/common'

export default {
	setup(){

     const CommonStore = commonStore()
		 const common = ref()
		  const details = ref("")
    const list = ref([])
    function goDetilas(item) {
      CommonStore.setRichText(item)
       uni.navigateTo({
         url: '/pagesInfo/web/commonAgreement'
       })
    }
		function getTutorials() {

      tutoriaList({
        pageNum:1,
        pageSize:15
      }).then(res => {
        list.value = res
				console.log('res',res)
				})
			}

			 onMounted(() => {
				 console.log("======onMounted====")
			     getTutorials();
			});

		return {
	      common,
		    details,
        list,
        goDetilas
	    };
	}
};




</script>

<style>
	page{
		background-color: #fff;
	}
</style>
<style lang="scss">
.container{
  padding-bottom: 200rpx;
}
.text-ellipsis {

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1; /* 显示的行数 */
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%; /* 文本最大宽度 */
  width:75%
}
.rail-container{
  width: 100%;
  padding:  32rpx;
  display: flex;
  .coverImage{
    width: 160rpx;
    height: 160rpx;
    border-radius: 10rpx;
  }
  .right_box{
    box-sizing: border-box;
    flex: 1;
    margin-left: 24rpx;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24rpx 0;
  }
}
</style>
